import axios from '../utils/axios'

let Service = {};

Service = {
  test(params) {
    return axios.post('/test', params);
  },
  /**
   * user
   */
  getAllUser(params) {
    return axios.get(`/user/getAllUser`, {
      params,
    });
  },

  /**
   * diseaseType
   */
  postAddDiseaseType(params){
    return axios.post(`/diseaseType/addType`,params);
  },
  getAllType(params){
    return axios.get(`/diseaseType/getAllType`, {
      params,
    });
  },
  updType(params){
    return axios.post(`/diseaseType/updType`,params);
  },
  delType(params){
    return axios.get(`/diseaseType/delType`, {
      params,
    });
  },
  /**
   * disease
   */
  getAllDisease(params){
    return axios.get(`/disease/getAllDisease`, {
      params,
    });
  },
  postAddDisease(params){
    return axios.post(`/disease/addDisease`,params);
  },
  editDisease(params){
    return axios.post(`/disease/updDisease`,params);
  },
  delDisease(params){
    return axios.get(`/disease/delDisease`, {
      params,
    });
  },

  /**
   * 文章管理
   */
  getAllArtical(params){
    return axios.get(`/artical/getAllArtical`, {
      params,
    });
  },
  delArtical(params){
    return axios.get(`/artical/delArtical`, {
      params,
    });
  },
  passArtical(params){
    return axios.get(`/artical/passArtical`, {
      params,
    });
  },

  /**
   * 视频管理
   */
   getAllVideo(params){
    return axios.get(`/video/getAllVideo`, {
      params,
    });
  },
  delVideo(params){
    return axios.get(`/video/delVideo`, {
      params,
    });
  },
  passVideo(params){
    return axios.get(`/video/passVideo`, {
      params,
    });
  },

  /**
   * 直播记录
   */
  getAllLive(params){
    return axios.get(`/live/getAllLive`, {
      params,
    });
  },
  delLive(params){
    return axios.get(`/live/delLive`, {
      params,
    });
  },


  /** 小毕设 */
  postlogin(params) {
    return axios.post('/login', params,{
      'Content-Type':'application/x-www-form-urlencoded'
    });
  },
  postregister(params) {
    return axios.post('/register', params);
  },
  getVerificationCode(params) {
    return axios.get(`/getVerificationCode`, {
      params
    });
  },
  
  editUserInfo(params) {
    return axios.post('/user/editUserInfo', params);
  },
  getOtherUserInfo(params) {
    return axios.get(`/user/getOtherUserInfo`, {
      params,
    });
  },
  /**
   * 帖子
   */
  getAllDiscussPost(params) {
    return axios.get('/community/getAllDiscussPost', {
      params
    });
  },
  getDiscussPostDetails(params) {
    return axios.get('/community/getDiscussPostDetails', {
      params
    });
  },
  like(params) {
    return axios.post('/community/like', params);
  },
  postDiscussPost(params) {
    return axios.post('/community/postDiscussPost', params);
  },
  getMyDiscussPost(params) {
    return axios.post('/community/getMyDiscussPost', {
      params
    });
  },
  getOtherUserDiscussPost(params) {
    return axios.get('/community/getOtherUserDiscussPost', {
      params
    });
  },
  delDiscussPost(params) {
    return axios.post('/community/delDiscussPost', params);
  },
  getLeaderboard(params) {
    return axios.get('/community/getLeaderboard', {params});
  },
  /**
   * 帖子评论
   */
  addComment(params) {
    return axios.post('/comment/addComment', params);
  },
  delComment(params) {
    return axios.post('/comment/delComment', params);
  },
  /**
   * 订单
   */
  getAllOrder(params) {
    return axios.get('/order/getAllOrder', {
      params
    });
  },
  placeOrder(params) {
    return axios.post('/order/placeOrder', params);
  },
  getMyOrder(params) {
    return axios.post('/order/getMyOrder', {
      params
    });
  },
  postOrder(params) {
    return axios.post('/order/postOrder', params);
  },
  /**
   * 关注
   */
  getFollowersDynamics(params) {
    return axios.post('/follow/getFollowersDynamics', params);
  },
  postfollow(params) {
    return axios.post('/follow/follow', params);
  },
  unfollow(params) {
    return axios.post('/follow/unfollow',params);
  },
  isFollow(params) {
    return axios.post('/follow/isFollow',params);
  },


  /**
   * admin api
   */
  adminLogin(params){
    return axios.post(`/admin/login`, params);
  },
  getAllUserInfo(params) {
    return axios.post('/admin/getAllUserInfo',params);
  },
  getAllDiscussPost(params) {
    return axios.post('/admin/getAllDiscussPost',params);
  },
  getAllOrder(params) {
    return axios.post('/admin/getAllOrder',params);
  },
  delDiscussPost(params) {
    return axios.post('/admin/delDiscussPost',params);
  },
  delOrder(params) {
    return axios.post('/admin/delOrder',params);
  },
  delUser(params) {
    return axios.post('/admin/delUser',params);
  },
}



export default Service;